package com.example.springbootmybatisplusdatapermission.data;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    // 根据用户名查询用户信息
    public User findByUsername(String username) {
        return userMapper.findByUsername(username);
    }

    // 查询用户的角色信息
    public List<String> findRolesByUsername(String username) {
        return userMapper.findRolesByUsername(username);
    }

    // 查询用户的数据权限范围
    public String findDataScopeByUsername(String username) {
        return userMapper.findDataScopeByUsername(username);
    }
}

